var form;
var table;
var $;
layui.use(['layer','form','table'],function(){
    form = layui.form;
    table=layui.table;
    $=layui.$;


});

$('#confirm').on('click',function(){
    var productCode=$('input[name=productCode]').val();
    var productName=$('input[name=productName]').val();
    var currentpriceProduct=$('input[name=currentpriceProduct]').val();
    var categroyName=$('input[name=categroyName]').val();
    var condition=$('#condition option:selected').text();
    if(condition=="上架"){
        condition=1;
    }else if(condition=="下架"){
        condition=2;
    }else{
        condition=null;
    }
    var productLabel=$('input[name=productLabel]').val();

    parent.$("input[name='productCode1']").val(productCode);
    parent.$("input[name='productName1']").val(productName);
    parent.$("input[name='currentpriceProduct1']").val(currentpriceProduct);
    parent.$("input[name='categroyName1']").val(categroyName);
    parent.$("input[name='condition1']").val(condition);
    parent.$("input[name='productLabel1']").val(productLabel);

    parent.sousuo();

    var layer_1=parent.layer_1;
    layer_1.close(layer_1.index);
})
//重置
$('#reset').on('click',function(){
    $("input").val("");
    $(this).find("option:selected").removeAttr("selected");
})